<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="row">
    	<div class="col-sm-12 search-collapse">
			<form id="idleTotal-form">
				<div class="select-list">
					<ul>
						<li>
							姓名：<input type="text" name="empNm"/>
						</li>
						<li>
							证件号码：<input type="text" name="empId"/>
						</li>
						<li>
							公司名称：<input type="text" name="compNm"/>
						</li>
						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
						    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
					</ul>
				</div>
			</form>
		</div>
		<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
			<a class="btn btn-primary btn-edit disabled" onclick="detail()">
	            <i class="fa fa-edit"></i> 查看明细
	        </a>
		</div>
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "pm/idleTotal";

        $(function() {
            var options = {
                url: prefix + "/total",
                modalName: "人员缺勤统计",
                search:false,
                showSearch:false,
                showColumns:false,
                showToggle:false,
                showExport:false,
                showRefresh:false,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'empId', 
					title : '证件号码' 
				},
				{
					field : 'empNm', 
					title : '姓名' 
				},
				{
					field : 'compNm', 
					title : '供应商名称' 
				},
				{
					field : 'idleDays', 
					title : '缺勤天数' 
				}]
            };
            $.table.init(options);
        });
        
        // 查看缺勤明细信息
        function detail(){
        	var row = $('#bootstrap-table').bootstrapTable('getSelections')[0];
 		    var url = ctx + "pm/idleTotal/detail/" + row.empId;
 		    createMenuItem(url, "缺勤明细");
        }
    </script>
</body>
</html>